home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / comm / dep309.zip / DEPARC.EXE / SCRIPTS.EXE / CIXMAIL.DSL < prev    next >
Text File  |  1993-10-21  |  3KB  |  77 lines

  1. Script Cixmail;     (* Version 1.10 by Michael Spalter *)
  2. VAR
  3. Name    : ARRAY[0..100] OF STRING;        (* Will handle 100 names *)
  4. Outward : ARRAY[0..100] OF INTEGER;
  5. Inward  : ARRAY[0..100] OF INTEGER;
  6. Fhandle : INTEGER;
  7. Different : INTEGER;
  8. Round : INTEGER;        (* NOTE: This is not a very useful script !  *)
  9. Start : INTEGER;        (* It is designed to show string and integer *)
  10. Done : INTEGER;         (* Arrays, file handling and various loops   *)
  11. Line : STRING[80];      (* and other constructions.                  *)
  12. Out : BOOLEAN;          (* so, even if you're not a TP user, this    *)
  13. BEGIN                   (* script may be useful for reference.....   *)
  14. ClrScr;
  15. WrLn('┌──────────────────────────────────────────────┐');
  16. WrLn('│   CixMail For Deputy & Telepathy Mail Files  │');
  17. WrLn('└──────────────────────────────────────────────┘\n');
  18. WrLn('This program will sort through your Telepathy mail file');
  19. WrLn('and then give a complete list of everyone who has sent');
  20. WrLn('you mail and everyone who you have sent mail to. ');
  21. WrLn('\nProcessing Cix mail file.....Please be patient.\n');
  22. WrLn('< PRESS ANY KEY TO STOP >\r\n');
  23. Escape(FALSE);
  24. Different:=0;
  25. FHandle:=FOPEN('\messages');
  26.    IF Fhandle=-1 THEN 
  27.    Write('\rMail file not found !!!!\r\n\n'); 
  28.    HaltScript;
  29.    END;
  30.    WHILE (NOT FEOF(FHandle)) AND (NOT KeyPressed) DO
  31.    FRead(FHandle,Line);
  32.       IF (Slice(Line,0,5)="From:") OR (Slice(Line,0,3)="To:") THEN
  33.          IF Slice(Line,0,5)="From:" THEN Out:=FALSE ELSE Out:=TRUE; END;
  34.          IF Out=TRUE THEN Start:=4; ELSE Start:=6; END;
  35.          Line:=Slice(Line,Start,(POS(Line,'.')-Start));
  36.          INC(Done);
  37.          Write('Processed: ',Done,' messages. Current: ',Line);
  38.          IF Out THEN Write(' (Outward)'); ELSE Write('(Inward)'); END;
  39.          Write('             ');
  40.          GotoXY(0,WhereY);
  41.            Round:=0;
  42.            REPEAT
  43.            INC(Round);
  44.            UNTIL (Line=Name[Round]) OR (Round>Different);
  45.               IF Round>Different THEN
  46.               Name[Round]:=Line;
  47.               INC(Different);
  48.               END;
  49.               IF Out=TRUE THEN 
  50.               INC(Outward[Round]); ELSE 
  51.               INC(Inward[Round]); 
  52.               END;
  53.       END;
  54.    END;
  55. FClose(Fhandle);
  56. ClrScr;
  57. WrLn;
  58. Write('Cix/Telepathy Mail Statistics           OUT   IN\n\r');
  59. Write('-----------------------------           --------\n\r');
  60. FHandle:=FCreate('names.txt');
  61.    FWriteLn(FHandle,'To   From        Cix ID'); 
  62.    FWriteLn(FHandle,'-----------------------'); 
  63.    FOR Round:=1 TO Different DO
  64.    Fwrite(FHandle,Outward[Round]); 
  65.    FWrite(FHandle,'     ');
  66.    Fwrite(FHandle,Inward[Round]); 
  67.    FWrite(FHandle,'        ');
  68.    FWriteLn(FHandle,Name[Round]); 
  69.    Write(Name[Round]);
  70.    GotoXY(42,WhereY); Write(Outward[Round]); 
  71.    GotoXY(47,WhereY); Write(Inward[Round]);  WrLn; 
  72.    END;
  73. FClose(Fhandle);
  74. WrLn('\r\nTime Taken: ',ScriptTime,' seconds.');
  75. Write('Results have been written to file "names.txt"\n\r\n');
  76. END CixMail.
  77.